package cn.itcast.nems.studentrecord.service.impl;

import cn.itcast.nems.studentrecord.dto.change.StudentRecordChangeCheckOriginDTO;
import cn.itcast.nems.studentrecord.dto.change.StudentRecordTransactionChangeCheckDTO;
import cn.itcast.nems.studentrecord.enumeration.StudentRecordStateEnum;

import java.util.List;

/**
 * 检查学籍变更是否允许（重读）
 *
 * @author liyong
 * create: 2023-12-11 19:21:30
 **/
class StudentRecordChangeRepeatChecker extends StudentRecordChangeChecker {

    /**
     * 检查学籍是否可以变更
     *
     * @param studentRecordOrigin       要变更的源学籍
     * @param studentRecordTransactions 学员学籍流转记录
     */
    StudentRecordChangeRepeatChecker(StudentRecordChangeCheckOriginDTO studentRecordOrigin,
                                     List<StudentRecordTransactionChangeCheckDTO> studentRecordTransactions) {
        super(studentRecordOrigin, studentRecordTransactions);
    }

    @Override
    void checkOriginStudentRecord() {
        if (!StudentRecordStateEnum.VALID.name().equals(this.studentRecordOrigin.getState())) {
            this.cannotChange("原班级学籍尚未生效");
        }

        // TODO 原班级没有因为非“结课”、“退学”原因出班。
    }
}
